#ifndef TK_H
#define TK_H

#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdlib.h>
#define N 100 //used in easy version of bucket_sort. Macro "N" is the scope of array. But the function "Bucket" have not considered the stability and cannot process minus or decimal.

bool sort(int n,int array[],char *name,char **argv);

void Bubble(int n,int array[],char *name);

void Insert(int n,int array[],char *name);

void Select(int n,int array[],char *name);

void Merge(int n,int array[],char *name);
void merge_recursion(int array[],int p,int r);
void merge(int array[],int p,int q,int r);

void Quick(int n,int array[],char *name);
void quick_recursion(int array[],int p,int r);
int partition(int array[],int p,int q);

void Bucket_case2(int n,int array[],char *name);//easy version

void Count(int n,int array[],char *name);//The advanced version of Bucket_case2. Minus supported but decimal.
int get_max(int n,int *array);
void Isminus(int n,int *array,int *flag);
int get_min(int n,int *array);

void Radix(int n,int array[],char *name);
int get_bit(int num);
int get_lowbit(int num,int bit);

void Heap(int n,int *array,char *name);
void buildheap(int n,int *array);
void swap(int *array,int i,int j);
void heapify(int *array,int i,int n);

#endif
